// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage

//testcase name：综合操作查询用户
//author：feizhao
//date：2017-11-09
//discription：用于测试登陆后，综合操作中对用户的查询操作
//step：1.登录综合业务综合操作主页面  2.输入用户编号，用户姓名，电话等查询用户
//修改人：
//修改日期：
//修改内容：

const accountConfig = {
  username: '1',
  password: '1',
}
 module.exports = {
   ' tests': function (browser) {
     browser
    .url('http://127.0.0.1:8080').maximizeWindow()
     .pause(1000)
     .waitForElementVisible('body', 100)
     .setValue('input[type=text]',accountConfig.username)
     .pause(100)
     .setValue('input[type=password]',accountConfig.password)
     .pause(100)
     .click('button[id=login-button]')
     .pause(1000)
     .click('#vc-tree-name-综合业务')
     .pause(1000)
     .click('#vc-tree-name-综合操作')
//用户查新
     .pause(1000)
     .setValue('.form-inline :nth-child(3) input[placeholder=用户编号]','4004000501')
     .pause(1000)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue('.form-inline :nth-child(3) input[placeholder=用户编号')
     .pause(300)
     .setValue('input[placeholder=合同编号]','100100')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue('input[placeholder=合同编号')
     .pause(300)
     .setValue('input[placeholder=用户姓名]','王五')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue(' input[placeholder=用户姓名')
     .pause(300)
     .setValue('input[placeholder=电话]','18502012345')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue(' input[placeholder=电话')
     .pause(300)
     .setValue('input[placeholder=表编号]','4004000423')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue(' input[placeholder=表编号')
     .pause(300)
     .setValue('input[placeholder=表号]','001001')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(5000)
     .clearValue(' input[placeholder=表号')
     .pause(300)
     .click('.form-inline :nth-child(9) div button')
     .pause(100)
     .click('.form-inline :nth-child(9) div ul :nth-child(2) ')
     .pause(1000)
     .click('.form-inline :nth-child(9) div button')
     .pause(100)
     .click('.form-inline :nth-child(9) div ul :nth-child(3) ')
     .pause(1000)
     .click('.form-inline :nth-child(9) div button')
     .pause(100)
     .click('.form-inline :nth-child(9) div ul :nth-child(1) ')
     .pause(1000)
     .click('.form-inline :nth-child(10) div button')
     .pause(100)
     .click('.form-inline :nth-child(10) div ul :nth-child(3) ')
     .pause(1000)
     .click('.form-inline :nth-child(10) div button')
     .pause(100)
     .click('.form-inline :nth-child(10) div ul :nth-child(2) ')
     .pause(1000)
     .click('.form-inline :nth-child(10) div button')
     .pause(100)
     .click('.form-inline :nth-child(10) div ul :nth-child(1) ')
     .pause(100)
     .setValue('input[placeholder=用户地址]','科技二路')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(4000)
     .clearValue('input[placeholder=用户地址]')
     .pause(100)
     .setValue('input[placeholder=区域]','1')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(4000)
     .clearValue('input[placeholder=区域]')
     .pause(100)
     .setValue('input[placeholder=小区]','科技小区')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(4000)
     .clearValue('input[placeholder=小区]')
     .pause(1000)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(16) div button')
     .pause(100)
     .click('.form-inline :nth-child(16) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(16) div button')
     .pause(100)
     .click('.form-inline :nth-child(16) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(16) div button')
     .pause(100)
     .click('.form-inline :nth-child(16) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(17) div button')
     .pause(100)
     .click('.form-inline :nth-child(17) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(17) div button')
     .pause(100)
     .click('.form-inline :nth-child(17) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(17) div button')
     .pause(100)
     .click('.form-inline :nth-child(17) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(18) div button')
     .pause(100)
     .click('.form-inline :nth-child(18) div button :nth-child(1)')
     .pause(100)
     .click('.form-inline :nth-child(20) button')
     .pause(10000)
     .end();
   }
 }
